#!/usr/bin/env python3

import os, sys
import ctypes

assert os.name == 'posix' and sys.platform == 'darwin'


def idle():
    command = 'ioreg -c IOHIDSystem | grep HIDIdleTime | sed \'s#.*"HID#"HID#\''
    output = subp.check_output(command, stderr=subp.STDOUT, shell=True)
    return output